In C++, a set is an associative container that stores unique elements in a sorted order. In this article, we’ll explore different approaches to check if a set is empty in C++ STL....
Given a linked list of n nodes which is first sorted, then rotated by k elements. Find the value of k....
Given an array arr[] of size N (consisting of duplicates), the task is to check if the given array can be converted to a non-decreasing array by rotating it. If it’s not possible to do so, then print “No“. Otherwise, print “Yes“....
Given an N-ary tree and an integer K, the task is to print the Kth ancestors of all the nodes of the tree in level order manner. If K ancestors does not exist for a node, then print -1 for that node....
Given two strings str1 and str2, the task is to check if the two given strings are isomorphic to each other or not....
Given a string s and a character c, find if all occurrences of c appear together in s or not. If the character c does not appear in the string at all, the answer is true....
Given an array of n integers, slope of a line i. e., m and the intercept of the line i.e c, Count the number of ordered pairs(i, j) of points where i ? j, such that point (Ai, Aj) satisfies the line formed with given slope and intercept....
Given a string str that consists of lowercase English letters and brackets. The task is to reverse the substrings in each pair of matching parentheses, starting from the innermost one. The result should not contain any brackets....
Given a complete binary tree, traverse it such that all the boundary nodes are visited in Anti-Clockwise order starting from the root....